package yanchun.vip.spring.ioc.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import yanchun.vip.spring.ioc.model.po.User;

/**
 * @author SuYanchun
 * @since 2025-02-10 16:53
 */
@Configuration
public class UserConfig {

    /**
     * initMethod：指定初始化方法
     * destroyMethod：指定销毁方法
     *
     * @return User
     */
    @Bean(initMethod = "init", destroyMethod = "destroyUser")
    public User bleem() {
        return new User() {{
            setName("Bleem");
            setGender(1);
            setAge(28);
        }};
    }
}
